package com.laich.springcloud.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.laich.springcloud.entity.User;
import com.laich.springcloud.fallback.RemoteUserServiceFallbackFactory;


@FeignClient(contextId = "remoteUserService", 
value = "laich-user", fallbackFactory = RemoteUserServiceFallbackFactory.class)
public interface RemoteUserService {

	/**
	 * 通过用户名查询用户
	 * @param username 用户名
	 */
	@RequestMapping("/user/findByUserName/{username}")
	 public User findByUserName(@PathVariable("username") String username) ;
	
	@RequestMapping("/user/getUser/")
	 public User getUser(@RequestParam("id") String id) ;
}
